package com.ubxtech.jdk21.service.impl;

import com.ubxtech.mqtt.bo.MqttTopicBO;
import com.ubxtech.mqtt.service.MqttTopicService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Victor.Xiao
 * @since 2024-04-22 14:26
 **/
//@Service("mqttTopicService")
public class MqttTopicServiceImpl implements MqttTopicService {
    @Override
    public List<MqttTopicBO> getInitTopics(String channel) {
        MqttTopicBO mqttTopicBO = new MqttTopicBO();
        mqttTopicBO.setSubTopic("channel1_topic_test1");

        MqttTopicBO mqttTopicBO1 = new MqttTopicBO();
        mqttTopicBO1.setSubTopic("channel1_topic_test2");
        List<MqttTopicBO> result = new ArrayList<>();
        if ("channel1".equals(channel)) {
            result.add(mqttTopicBO);
        }else {
            result.add(mqttTopicBO1);
        }
        return result;
    }
}
